package mystatic.src.LT;

import mystatic.src.LT.Book.BookList;
import mystatic.src.LT.User.AdminUser;
import mystatic.src.LT.User.NormalUser;
import mystatic.src.LT.User.User;

import java.util.Scanner;

public class Main {
    public static User login(){
        System.out.println("请输入您的姓名：");
        Scanner sc = new Scanner(System.in);
        String name = sc.nextLine();
        System.out.println("请输入您的身份：1.管理员  2.用户");
        int choice = sc.nextInt();
        System.out.println("欢迎 "+name+" 访问图书管理系统");
        if(choice == 1){
            return new AdminUser(name);
        }
        else return new NormalUser(name);
    }

    public static void main(String[] args) {
        User user=login();
        BookList bookList=new BookList();
        while(true){
            int choice=user.menu();
            user.DoWork(choice,bookList);
        }
    }
}
